{% extends 'layout.html' %}
{% block content %}
  <div class="container">
    <div style="margin-bottom: 10px;">
      <a href="/depart/add/" class="btn btn-success">
        <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
        新建部门
      </a>
    </div>
    <div class="panel panel-default">
      <div class="panel-heading">
        <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
        部门列表
      </div>
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>ID</th>
            <th>名称</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          {% for obj in queryset %}
          <tr>               
            <td>{{obj.id}}</td>
            <td>{{obj.title}}</td>
            <td>
              <a href="/depart/{{obj.id}}/edit/" class="btn btn-primary btn-xs">编辑</a>
              <a href="/depart/delete/?nid={{obj.id}}" class="btn btn-danger btn-xs">删除</a>
            </td>
          </tr>   
          {% endfor %}          
        </tbody>
      </table>
    </div>
  </div>
{% endblock %}